#include "Game.h"
#include "MessageProcessor.h"
#include <iostream>

Game::Game()
{
    m_World = 0;
    m_Quit = 0;
}

Game::~Game()
{
}

void Game::Init()
{
    m_World = new World;


}

void Game::Destroy()
{
    if (m_World)
    {
        delete m_World;
    }

    m_World = 0;

}

void Game::Update()
{
    m_Camera.MakeViewMatrix();

    m_Camera.Update();

    if (m_World)
    {
        m_World->Update();
    }
}

void Game::Render (Renderer *renderer)
{
    renderer->CameraTransformation (m_Camera.GetViewMatrix());

    renderer->BeginScene();
    m_World->Render(renderer);
    renderer->EndScene();
}
